<%@include file="../common/CheckLoginBackend.jsp" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <link type="text/css" rel="stylesheet" href="../statics/css/style.css"/>
    <script type="text/javascript" src="../statics/js/jquery.js"></script>
    <title>二组牛逼</title>
</head>
<body>
<%@include file="../common/Admin_Header.jsp" %>
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
    <div class="m_content">

        <%@include file="../common/Admin_left.jsp" %>

        <div class="m_right" id="content">
            <!-- 判断修改/添加 -->
            <c:if test="${productCategory==null }">
                <div class="mem_tit">添加分类</div>
            </c:if>
            <c:if test="${productCategory!=null }">
                <div class="mem_tit">修改分类</div>
            </c:if>
            <br/>
            <form action="CategoryListServlet?action=add3" method="post">
                <!-- 根据隐藏域内ID进入Servlet判断执行新增或修改 -->
                <input type="hidden"
                       value="
						<c:if test="${productCategory!=null}">${productCategory.id}</c:if>
						<c:if test="${productCategory==null}">0</c:if>"
                       name="id"/>
                <table border="0" class="add_tab" style="width:930px;"
                       cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="5%">所属二级分类</td>
                        <td width="10%"><select name="categoryLevel2Id"
                                                style="background-color:#f6f6f6;" id="productCategoryLevel2"
                                                onchange="yiji()">
                            <c:forEach items="${pcList.get(1)}" var="pc2" varStatus="v">
                                <option value="${pc2.id}"
                                        <c:if test="${pc2.id==productCategory.parentId}">
                                            selected</c:if>>${pc2.name}</option>
                            </c:forEach>
                        </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="5%">三级分类名称</td>
                        <td width="10%"><input type="text"
                                               value="<c:if test="${productCategory!=null}">${productCategory.name}</c:if>"
                                               name="name" required/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <!-- 根据requestScope中是否存在数据进入Servlet判断执行新增或修改 -->
                        <td><c:if test="${productCategory==null }">
                            <input type="submit" value="添加分类" class="s_btn"/>
                        </c:if> <c:if test="${productCategory!=null }">
                            <input type="submit" value="确定修改" class="s_btn"/>
                        </c:if>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>